home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
The Fatted Calf
/
The Fatted Calf.iso
/
Applications
/
Unix
/
Piper
/
SampleScripts
/
QuoteMail
/
script
< prev
Wrap
Text File
|
1993-01-25
|
535b
|
23 lines
#!/bin/sh
# Simple awk script to limit data to 60 chars per line
# and precede each line with a ">". The presence of the
# "Return type" field in the options file makes it paste
# the output back to the called, eg Mail Send window.
# (Note: not all apps support this paste back feature).
awk '
BEGIN {len=1; printf ">"}
{
if(NF==0){
printf "\n>\n>";
len=1
}else{
for(i=1;i<=NF;i++){
len+=(length($i)+1);
if(len>60){ printf "\n>"; len=length($i)+2 }
printf "%s ", $i
}
}
}
END {printf "\n"}
'